package com.fr.report.web.ui.impl;

import com.fr.base.Inter;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.report.web.ui.Icon;
import com.fr.report.web.ui.IconManager;
import com.fr.report.web.ui.ToolBarButton;
import com.fr.report.web.ui.WebContentUtils;
import com.fr.web.Repository;

public final class PDFPrint extends ToolBarButton
{
  private boolean isPopup = false;

  public PDFPrint()
  {
    super(Inter.getLocText("Utils-Print[Client]"), IconManager.PDFPRINT.getName());
  }

  public boolean isPopup()
  {
    return this.isPopup;
  }

  public void setPopup(boolean paramBoolean)
  {
    this.isPopup = paramBoolean;
  }

  protected String clickAction(Repository paramRepository)
  {
    return WebContentUtils.getPDFPrintAction(paramRepository, this.isPopup);
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if (paramXMLableReader.isChildNode())
    {
      String str = paramXMLableReader.getTagName();
      if ((str.equals("isPopup")) && (paramXMLableReader.getElementValue() != null))
        setPopup(true);
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    super.writeXML(paramXMLPrintWriter);
    if (this.isPopup)
      paramXMLPrintWriter.startTAG("isPopup").textNode(String.valueOf(this.isPopup)).end();
  }
}